import request from '@/utils/request'

// 查询成分列表列表
export function listNutrition(query) {
  return request({
    url: '/manage/nutrition/list',
    method: 'get',
    params: query
  })
}

// 查询成分列表详细
export function getNutrition(nutritionId) {
  return request({
    url: '/manage/nutrition/' + nutritionId,
    method: 'get'
  })
}

// 新增成分列表
export function addNutrition(data) {
  return request({
    url: '/manage/nutrition',
    method: 'post',
    data: data
  })
}

// 修改成分列表
export function updateNutrition(data) {
  return request({
    url: '/manage/nutrition',
    method: 'put',
    data: data
  })
}

// 删除成分列表
export function delNutrition(nutritionId) {
  return request({
    url: '/manage/nutrition/' + nutritionId,
    method: 'delete'
  })
}
